package com.jason.bookworm.exception;

import com.jason.bookworm.response.StatusEnum;

public class ServiceException extends RuntimeException {
    private final Integer code;

    public ServiceException(){
        super("系统运行错误！请稍后再试。");
        this.code= StatusEnum.System_ERR.getCode();
    }

    public ServiceException(StatusEnum status){
        super(status.getMsg());
        this.code=status.getCode();
    }

    public ServiceException(StatusEnum status,String msg){
        super(msg);
        this.code=status.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
